#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
using PCC = pair<char, char>;
const int N = 2e5 + 10;

int n;
char str1[N], str2[N];
int g[30][30];

void solve(){
    memset(g, 0, sizeof g);
    cin >> n;
    cin >> str1 >> str2;

    for(int i = 0; i < n; i ++){
        int x = str1[i] - 'a', y = str2[n - i - 1] - 'a';
        if(x < y) g[x][y] ++;
        else g[y][x] ++;
    }



    int st = 0;
    for(int i = 0; i <= 25; i ++){
        for(int j = 0; j <= 25; j ++){
            if(g[i][j] % 2 && i == j){
                st ++;
            }

            if(g[i][j] % 2 && i != j){
                cout << "NO\n";
                return;
            }
        }
    }




    if((n % 2 && st == 1) || (n % 2 == 0 && st == 0)){
        cout << "YES" << '\n';
    }else{
        cout << "NO" << '\n';
    }


}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int T;
    cin >> T;
    while(T--){
        solve();
    }
    return 0;
}